define(['app'], function(app) {
	'use strict';

	// 实例化方法
	var factory = function(Http) {
		
		return{
			//红包雨详情
			getDetail:function(session,red_id,callback){
				Http.post({
					method:'shop.red.getdetail',
					session:session,
					red_id:red_id
				},function(result){
					if(callback){
						callback(result)
					}
				})
			},
			//发送红包请求,返回所获得红包金额
			//点中第一个红包，就请求改接口，但是等持续时间结束才显示金额
			getRecord:function(session,red_id,callback){
				Http.post({
					method:'shop.red.getrecord',
					session:session,
					red_id:red_id
				},function(result){
					if(callback){
						callback(result)
					}
				})
			}
			
			
		};
	}

	factory.$inject = ['Http'];
	
	return app.registerService("Hongbaodetail", factory);
});